package fatworm.query.constant;

import fatworm.util.Lib;

public class StringConstant implements Constant {
	
	private String val;
	
	public StringConstant(String val) {
		this.val = val;
	}
	
	public Object asJavaVal() {
		return val;
	}
	
	public boolean equals(Object obj) {
		StringConstant sc = (StringConstant)obj;
		if (sc != null && val.equals(sc.val))
			return true;
		else
			return false;
	}
	
	public int compareTo(Constant c) {
		StringConstant sc = (StringConstant)c;
		return val.compareTo(sc.val);
	}
	
	public int hashCode() {
		return val.hashCode();
	}
	
	public String toString() {
		return val;
	}
	
	public Constant plus(Constant c) {
		Lib.assertNotReached();
		return null;
	}
}